<template>
	<view class="im-item-box">
		<view class="im-time" v-if="itemResume.datetime">
			{{itemResume.datetime}}
		</view>
		<view class="resume-box" @click="handleLink">
			<view class="resume-top">
				<view class="resume-txt1">
					<view class="resume-info">
						<view class="resume-name substring">{{itemResume.message.fullname}}</view>
						<view class="resume-reg substring">
							<text>{{itemResume.message.age}}岁</text>
							<text>{{itemResume.message.education}}</text>
							<text>{{itemResume.message.experience}}</text>
						</view>
					</view>
					<view class="resume-img">
						<image :src="itemResume.avatar"></image>
					</view>
				</view>
				<view class="resume-txt2 clearfix">
					<text class="label">期望：</text>
					<text class="job-txt">{{itemResume.message.intention_category}}</text>
					<text class="job-salary">{{itemResume.message.intention_wage}}</text>
				</view>
			</view>
			<view class="resume-bottom">
				<view class="resume-btm-txt1">{{itemResume.message.education_school}} · {{itemResume.message.education_major}}</view>
				<view class="resume-btm-txt2">{{itemResume.message.work_companyname}} · {{itemResume.message.work_jobname}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		parseTime,
		formatTime
	} from '@/utils/index.js'
	import {
		mapState
	} from 'vuex'
	export default {
		props: ['itemResume'],
		filters: {
			timeFilter(timestamp) {
				return formatTime(timestamp, '{y}-{m}-{d}', true)
			},
			interviewTimeFilter(timestamp) {
				return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}')
			}
		},
		computed: {
			...mapState(['LoginType'])
		},
		methods: {
			handleLink() {
				if(this.LoginType == 1){
					uni.navigateTo({
						url: '/commonViews/ResumeShow?id=' + this.itemResume.message.resumeid
					})
				} else if (this.LoginType == 2) {
					uni.navigateTo({
						url: '/personal/ResumePreview'
					})
				} 
			}
		}
	}
</script>
<style lang="scss" scoped>
	// 发送简历开始
	.resume-box {
		max-height: 432rpx;
		background: #FFFFFF;
		border-radius: 20rpx;
		font-size: 28rpx;
		margin: 0 36rpx 40rpx;
		padding: 0 20rpx;

		.resume-top {
			padding: 30rpx 0rpx 20rpx 16rpx;

			.resume-txt1 {
				display: flex;
				padding: 0rpx 0rpx 16rpx 0;

				.resume-img {
					width: 90rpx;
					height: 90rpx;
					border-radius: 50%;
					margin-left: 20rpx;

					image {
						width: 100%;
						height: 100%;
						border-radius: 50%;
					}
				}

				.resume-info {
					.resume-name {
						flex-shrink: 0;
						width: 500rpx;
						color: #333333;
						font-size: 34rpx;
						font-weight: bold;
						margin-bottom: 6rpx;
					}

					.resume-reg {
						flex-shrink: 0;
						width: 500rpx;

						text {
							color: #999;
							font-size: 26rpx;
							position: relative;
							margin-right: 30rpx;

							&::before {
								content: '';
								width: 1rpx;
								height: 25rpx;
								background: #999;
								display: block;
								position: absolute;
								right: -15rpx;
								top: 50%;
								transform: translateY(-50%);
							}

							&:last-child::before {
								display: none;
							}
						}
					}
				}
			}

			.resume-txt2 {
				position: relative;
				// margin-left: 12px;
				.label,
				.job-txt {
					color: #666666;
					font-size: 28rpx;
				}

				.job-salary {
					// color: $textActiveColor;
					font-size: 28rpx;
					margin-right: 20rpx;
					float: right;
				}
			}
		}

		.resume-bottom {
			border-top: 2rpx dotted #ededed;
			padding: 20rpx 0 25rpx 20rpx;
			color: #666666;
			font-size: 28rpx;

			.resume-btm-txt1 {
				margin-bottom: 8rpx;
				padding-left: 50rpx;
				background: url('@/im/static/img/resume-bg-1.png') no-repeat left center;
				background-size: 34rpx 30rpx;
				
			}

			.resume-btm-txt2 {
				padding-left: 50rpx;
				background: url('@/im/static/img/resume-bg-2.png') no-repeat left center;
				background-size: 32rpx 28rpx;

			}
		}
	}

	// 发送简历结束
</style>
